<template>
  <span id="count">{{ count }}</span>
  <test />
</template>
 
<script setup>
import { defineComponent, onErrorCaptured, ref } from 'vue'
import test from './test.vue'
 
const count = ref(0)
defineComponent({
  test
})
 
onErrorCaptured(err => {
  console.log('Caught error', err.message)
  ++count.value
  return false
})
</script>